home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
UTILITY
/
CED10E.ARJ
/
CED.DOC
< prev
Wrap
Text File
|
1991-07-24
|
91KB
|
2,377 lines
==========================
CED - DOS Command Editor
User's Guide
Version 1.0E
==========================
Copyright (c) 1985, 1986, 1991
The Cove Software Group
Post Office Box 1072
Columbia, MD 21044
(301) 992-9371
CompuServe: 76703,2002
Internet: 76703.2002@compuserve.com
Contents
Purpose . . . . . . . . . . . . . . . . . . . . 1
System Requirements . . . . . . . . . . . . . . 1
Terminology . . . . . . . . . . . . . . . . . . 2
Installation . . . . . . . . . . . . . . . . . 2
Command line editor . . . . . . . . . . . . . . 3
DOS command stack . . . . . . . . . . . . . . . 6
Application program command stack . . . . . . . 8
PCALL function . . . . . . . . . . . . . . . . 8
Synonyms . . . . . . . . . . . . . . . . . . . 9
User program synonyms . . . . . . . . . . . . 10
Compound synonyms . . . . . . . . . . . . . . 10
Command parameters . . . . . . . . . . . . . 13
Ignoring commands . . . . . . . . . . . . . . 14
Ignoring individual commands . . . . . . . . 15
Clearing CED objects . . . . . . . . . . . . 15
Configuration files . . . . . . . . . . . . . 16
Changing default buffer sizes . . . . . . . . 17
Status display . . . . . . . . . . . . . . . 19
Multiple definitions . . . . . . . . . . . . 19
Problem determination . . . . . . . . . . . . 19
Appendix A: Command summary . . . . . . . . . 22
Appendix B: Order of Processing . . . . . . . 24
Appendix C: Limitations . . . . . . . . . . . 25
Appendix D: Version History . . . . . . . . . 26
Appendix E: PCED (the commercial version) . . 27
Appendix F: Ordering PCED . . . . . . . . . . 31
Appendix G: User-installed commands . . . . . 32
Appendix H: User Command Demo . . . . . . . . 35
COPYRIGHT/LICENSE/WARRANTY . . . . . . . . . 37
Purpose
-------
CED (which stands for Command EDitor) provides the following
functions at the DOS prompt, or from within certain application
programs:
-- Improved command line editing facility.
-- Recall of previously issued commands for re-entry.
-- Command synonyms, which may include "chaining" of a
series of commands.
-- Parameterization of synonym commands.
-- Recall of parameters for previously issued commands.
-- User-settable buffer sizes for all functions.
-- For programmers, a facility to add new "resident"
commands to the DOS shell.
CED is a copyrighted but free program that was initially released
in 1985. Please see the copyright/license section at the end of
this manual for information about how you may use CED.
The Cove Software Group also publishes a commercial product
called PCED (Professional CED). PCED is a highly enhanced retail
version of CED. Please see Appendices E and F for information
about PCED.
Neither CED nor PCED is a shareware product. CED is free for
your personal use (with restrictions as described in the
license), and PCED is a commercial, for-sale program.
System Requirements
-------------------
CED requires an IBM PC, XT, AT, PCJr, PS/2, or true compatible.
There are no special hardware requirements.
CED requires DOS Version 2.00 or later. It increases the size of
resident DOS by about 16K bytes when installed. Most of this
space is, however, used for data storage, and the amount of
storage can be reduced. Thus, smaller versions of CED are
possible.
CED 1.0 User's Guide - 1
Terminology
-----------
The term "DOS command" refers to anything that is typed at the
DOS prompt OR at the prompt of a CED-compatible program such as
DEBUG.
The term "CED command" refers to a command that is specifically
directed to CED itself. These are used to define command
synonyms, adjust facets of CED's operation, etc. CED commands
always begin with the word "CED" and must be either (a) typed at
a command prompt, or (b) issued in a special configuration file.
CED commands cannot be used in batch files.
Keyboard key names are as follows:
<Up> The up-arrow key on the numeric keypad.
<Down> The down-arrow key on the numeric keypad.
<Left> The left-arrow key on the numeric keypad.
<Right> The right-arrow key on the numeric keypad.
<Backspace> The large left-arrow key, next to NumLock.
A caret (^) means to press the Ctrl key in conjunction with a
named key; for example, <^End> means "press and hold the Ctrl
key, then press <End>".
Words in CAPS are CED keywords and must be typed exactly as shown
(they need not be capitalized when you use them).
Words in [brackets] are optional elements of a command.
Installation
------------
Installation (in its simplest form) is accomplished by typing
"CED" at the DOS prompt, or including the statement "CED" in your
AUTOEXEC.BAT file. There are optional parameters when installing
CED; these will be covered later.
After CED is installed, everything will appear to be normal, but
you now have many new features when entering DOS commands. The
remainder of this document will describe these features.
CED is active either at the DOS prompt, or when an application
program requests buffered keyboard input from DOS (DOS function
0AH). There are a few such programs (DEBUG and EDLIN are two);
but the main use of CED is at the DOS prompt.
Once CED has been installed, the command "CED" becomes, in
effect, an internal DOS command. Thus, when you want to issue
CED commands (as explained below), you will type "CED <command>",
but the program file (CED.COM) need NOT be available on disk.
CED becomes fully memory resident and is an extension to DOS
CED 1.0 User's Guide - 2
after installation. In particular, this means that you should
NOT include a drive or path in issuing CED commands after initial
installation. A command like "C:CED SYN d dir" will reload CED
from disk and you'll get a message indicating that CED is already
loaded.
Because CED is active only at the DOS prompt and at the prompts
of compatible programs like DEBUG, you cannot use CED services in
batch files. In particular, neither CED commands nor synonyms
can be used in batch files. If you use CED commands in a batch
file, the program will be reloaded from disk and you'll receive a
message indicating that CED is already loaded. Note, however,
that you CAN issue a series of CED commands from a configuration
file (q.v.).
Command line editor
-------------------
CED provides a new "editor" for DOS commands. You will use this
editor whenever you type a DOS command, or when you enter data to
a compatible program such as DEBUG. CED's editor replaces all of
the DOS editing keys, including F1-F5.
There are two big differences between the CED editor and the DOS
editor. First, the CED editor always allows you to see all of
your data; where the DOS editor likes to "hide" characters, the
CED editor always displays all of the characters that it is
using. Second, the CED editor allows you to move the cursor
around within a command, which makes correcting and altering
commands much easier. The keystrokes that CED uses for editing
are very similar to those used by many word processors and text
editors; you will find command entry and editing to be much more
natural than with the DOS editor.
OVERTYPE AND INSERT MODES
The CED editor had two basic modes: the overtype mode and the
insert mode. In overtype mode (the normal mode), anything you
type will add to or replace the text currently displayed. In
insert mode, anything you type will be inserted into the text at
the current cursor position, moving any characters to the right
of the cursor out of the way. The <Ins> key toggles between
typeover and insert modes.
To demonstrate this, type some text at the DOS prompt, then use
the left-arrow key to move the cursor into the text you just
entered (note that the text is not erased; the arrow key simply
moves the cursor). Now type a few characters and observe that
they replace the text already there; this is overtype. Now press
the <Ins> key once to enter insert mode (note that the cursor
changes size to let you know that you're in insert mode), and
type some more text. Note that the new text is inserted into
CED 1.0 User's Guide - 3
your "command", and the remaining text is moved right, out of the
way. Press <Esc> to erase the command completely.
CED normally begins in overtype mode. If you wish, you can have
it start in insert mode by typing the CED command
CED INSMODE ON
To revert to the default overtype mode, type
CED INSMODE OFF
CURSOR MOVEMENT KEYS
CED uses the following keys to move the cursor around within the
command you are typing:
<Home> Moves the cursor to the "home" position, that
is, to the first character.
<End> Moves the cursor to the end position (follow-
ing the last character displayed).
<Left> Moves the cursor left one character. This
does not erase any characters; it simply
moves the cursor. Remember that <Left> is
the left-arrow key on the numeric keypad (key
4), not the backspace key (the larger left
arrow next to NumLock).
<Right> Moves the cursor right one character.
<^Left> Moves the cursor left one word. A "word" is
any sequence of characters bounded a space or
any of the following characters:
: \ ; , < > | = " + [ ]
The cursor will be placed on the first
character of the previous "word".
<^Right> Moves the cursor right one word; it will be
placed on the first character of the next
word.
TEXT DELETION KEYS
You can use the following CED editor keys to delete text:
<Del> Deletes the character at the cursor position.
CED 1.0 User's Guide - 4
<Backspace> Deletes the character to the left of the
cursor position, and moves the cursor left.
This is known as a destructive backspace; it
is exactly equivalent to keying <Left>
followed by <Del>.
<^End> Deletes all characters from the cursor
position to end of the command.
<^Home> Deletes all characters from the home position
(first character) to the cursor position, not
including the character at the cursor
position.
<Esc> Cancel: erases the command completely and
allows you to start over.
COPYING FROM TEMPLATE (EDLIN)
When DOS or user programs such as EDLIN request input from CED,
they provide it with an input "template". In almost all cases,
this template is a copy of the last command entered. The
template is the data that is used by the DOS editing keys
(<F1>-<F5>, etc.).
CED users will not need this template very often, because the
command stack (described below) provides a similar but much more
powerful function. There are a few cases, however, when the
template will be useful; the most important of these is seen in
the DOS line editor, EDLIN. If you do not use EDLIN, this topic
will probably not be of interest to you.
When you are editing a previously entered line (by typing the
line number at the EDLIN prompt), EDLIN places a copy of the line
to be edited into the template. In order to allow you to edit
the template directly, CED uses <F3> to copy the contents of the
template to the screen for editing. This is very similar in
effect to <F3> as used by DOS. So, when you want to edit an
Edlin text line, type the line number, followed by <F3>. This is
an example EDLIN session:
C> edlin test
End of input file
*1,3L
1:*This is line 1
2: This is line 2
3: This is line 3
*2
2:*This is line 2
2:*_
CED 1.0 User's Guide - 5
At this point, the text "This is line 2" is in the template, but
it is not displayed. To display the text and allow it to be
edited, just press <F3>, and the screen will appear as follows:
C> edlin test
End of input file
*1,3L
1:*This is line 1
2: This is line 2
3: This is line 3
*2
2:*This is line 2
2:*This is line 2_
As you can see, <F3> performs approximately as it would under the
DOS command editor.
<F3> is available any time CED is active, but, in most cases, it
will simply redisplay the last command entered.
DOS command stack
-----------------
CED keeps a record of each command you enter. You can retrieve
and re-enter these commands by using the <Up> and <Down> keys to
display the old commands, then pressing <Enter> when the desired
command is displayed (the command can be edited, of course).
You can visualize the stored data as a "stack" of commands. CED
keeps a pointer to somewhere in this stack. The pointer always
points to a location "between" two commands; when you press <Up>,
CED displays the command "above" the pointer, then moves the
pointer up one command. When you press <Down>, CED displays the
command "below" the pointer, then moves the pointer down one
command.
For example, suppose you have entered commands A, B, and C. The
stack will appear as follows:
+-------------+
| A |
+-------------+
| B |
+-------------+
| C |
+-------------+ <-- pointer
The stack is circular in nature; thus, if the pointer points
"below" the last command in the stack (as it does above), it is
actually between the last command (C) and the first command (A).
In the situation above, pressing <Up> will display command C and
leave the pointer between B and C. Pressing <Down> will display
command A, and leave the pointer between A and B.
CED 1.0 User's Guide - 6
When you recall an old command and re-enter it without editing,
the re-entered command is not added to the stack, and the pointer
will drop one level. Suppose, for example, that you press <Up>
twice from the position above (pointer below C): B is displayed,
and the stack looks like this:
+-------------+
| A |
+-------------+ <-- pointer
| B |
+-------------+
| C |
+-------------+
If you now press <Enter> (without editing the command), command B
will be sent to DOS, and the pointer will drop to point between B
and C. From there, <Up> will display B again, and <Down> will
display C. Thus you can "recycle" a series of commands by
pressing <Up> until you see the first command, <Enter> to execute
it, then a series of <Down><Enter> sequences to re-execute the
commands in the original order.
If you retrieve an old command and edit it before execution, the
newly edited command is added to the bottom of the stack, and the
pointer will point just below it.
CED will not stack any commands of two characters or less (the
theory being that it's easier to retype than to go searching
through the stack).
You can remove a command from the stack by displaying it and
pressing <^PgDn>, and you can clear the entire stack by pressing
<^PgUp>.
The actual number of commands which will be held in the stack is
a function of the length of the commands and the size of the
stack (which can be increased; see below for details).
This is one of those computer gizmos that's easier to use than it
is to explain. Just play with <Up> and <Down>; you'll get the
idea.
Saving and loading the stack
----------------------------
You can save the contents of the command stack to a disk file by
typing:
CED SAVESTK filename
For example:
CED 1.0 User's Guide - 7
CED SAVESTK current.stk
This command will save the current contents of the command stack
in a file named CURRENT.STK. This is a standard ASCII text file
that you can display (using TYPE or a file viewer) and edit
(using your text editor, EDLIN/EDIT, or a word processor in non-
document mode). Because the file contains DOS commands, you can
also give it a .BAT extension and use it as a batch file (but be
sure to remove the SAVESTK command and any other CED commands
before doing so.)
You can also load the contents of a disk file into the command
stack by typing:
CED LOADSTK filename
For example:
CED LOADSTK current.stk
This command would add the contents of CURRENT.STK to CED's
command stack. Be sure that the file contains only executable
commands and is in ASCII format! CED does not check the
"reasonableness" of the file.
Application program command stack
---------------------------------
CED actually keeps two complete command stacks: one is for DOS
commands, the other for commands entered into compatible appli-
cation programs (DEBUG, et al). Thus, DOS commands will not
appear in the command stack while in DEBUG, and vice versa.
The SAVESTK and LOADSTK functions do not use or affect this "user
program" command stack
PCALL function
--------------
"PCALL" stands for parameter recall; this is a second way to
quickly retrieve old commands. PCALL simply remembers old
parameters to specific commands. For example, suppose you have
an editor called "edit", and the last time you executed it, you
used "edit c:\util\foo.doc". If you now enter "edit" without any
parameters, CED will assume that you want to edit the same file
and will supply the "c:\util\foo.doc" for you.
You could, of course, scroll back through the command buffer to
find the old command, but it might take a while to find it (and
the command might be missing if it was too long ago).
CED 1.0 User's Guide - 8
Because many commands are best used WITHOUT parameter recall
(FORMAT and ERASE are good examples), CED will only use PCALL on
commands that you specify. To make a command "PCALLable", type
CED PCALL <command>
at the DOS prompt. For example, if you want to make "edit" a
PCALL command, type
CED PCALL edit
(Remember that the CED diskette need not be available).
If you wish to issue a command for which PCALL is enabled, but
you do not want it to have parameters, add a space after the
command. For example, suppose you have issued a "CED PCALL dir"
command and your last dir was a "dir *.exe". If you now type
"dir", CED will add the "*.exe" automatically. However, if you
type "dir " (note the space), CED will not add the "*.exe", and
you'll get a full directory.
You may also bypass PCALL processing through the use of the
ignore character; see below, under "Ignoring Individual
Commands".
Synonyms
--------
The synonym function allows you to define brief "synonyms" for
frequently used commands. For example, suppose you invoke your
communications package by typing "talk rbbs /c63". CED allows
you to abbreviate this to a shorter command, say, "bb", by typing
at the DOS prompt:
CED SYN bb talk rbbs /c63
The exact syntax is:
CED SYN <synonym> <command>
The <synonym> is the command abbreviation (which you will type at
the DOS prompt), and <command> is the word or phrase that CED
will substitute when it sees <synonym>. The synonym is always
the first word after the keyword "syn", and <command> is always
all of the remaining words.
For example, "CED syn d dir" allows you to type "d" instead of
"dir". You may add parameters: "d *.exe" becomes equivalent to
"dir *.exe".
Many people define very short synonyms for frequently used
commands:
CED 1.0 User's Guide - 9
CED SYN d dir
CED SYN e edit
CED SYN g debug
CED SYN l link
CED SYN rbbs talk rbbs /c63
CED SYN cc1 cc1 -bpe
Note in the last example that you can use a synonym that is
identical to its associated phrase and simply use it to automat-
ically add parameters.
Also note that synonym processing takes place AFTER PCALL
processing; thus if you use a command synonym and wish the
command to be "PCALLable", use the synonym in the PCALL command.
For example:
CED SYN e edit
CED PCALL e (not PCALL edit)
User program synonyms
---------------------
Because CED "knows" whether it is being used from the DOS prompt
or from an application program such as DEBUG, it is possible to
define separate sets of synonyms for DOS commands and for user
programs. The syntax for a "user synonym" is
CED USERSYN <synonym> <command>
This is identical to the SYN command except for the new keyword
USERSYN. For example, if you need to frequently type the DEBUG
command "d ds:1010 1200", you might use
CED USERSYN d1 d es:1010 1200
(Remember that DEBUG is a CED-compatible program; thus you can
type CED commands at the DEBUG prompt.) Then you could simply
type "d1" to dump memory from the specified address. Note that
a "d1" USERSYN is separate from a "d1" SYN; at the DOS prompt
you'd get the SYN, in DEBUG or EDLIN you'd get the USERSYN.
Compound synonyms
-----------------
Just as there are simple and compound sentences, there are simple
a compound synonyms. A compound synonym is simply a synonym that
issues more than one command; these commands are issued
sequentially at succeeding DOS prompts, much like a batch file.
This is called "chaining" because commands are "chained"
together, one after the other.
CED 1.0 User's Guide - 10
Suppose, for example, that in order to run your communications
package, you always type:
cd \talk
talk cis /c63
cd \
You could put this sequence into one synonym by typing
CED SYN cis cd \talk^talk cis /c63^cd \
The ^ character serves as a command separator. When you type CIS
at the prompt, CED will output everything up to the ^ (in this
case, "cd \talk") and then simulate an <Enter>. The next time
DOS requests input, it will get "talk cis /c63<Enter>", and so
on.
Note that CED will not pass DOS commands to user programs; thus,
in
CED SYN bug cd \util^debug^cd \
DEBUG would not see the trailing "cd \", which would still be
held up until you return to the DOS prompt.
The first of the chained commands (e.g., the first 'cd \' above)
cannot itself be a synonym, but the remaining commands can. That
is, if 'f' and 'g' are synonyms, the command
CED SYN h dir^f^g
will work as you expect. Be careful, though. A command like
CED SYN f dir^f
will put the computer into a loop from which there is no retreat.
It may be useful in some circumstances, however, to fool CED into
allowing the first command to be a synonym by simply inserting a
^ as the first character of the chain:
CED SYN d dir
CED SYN f ^d^cd \
When "f" is keyed, CED will first pass a null string to DOS, then
"dir" and "cd \". This trick will work OK at the DOS prompt, but
it may cause problems in some user programs (it would insert a
blank line, for example, if you were in EDLIN line-insert mode).
Compound synonyms can be "nested", i.e., one synonym can call
another. Consider the following pair of definitions:
CED SYN 1 a^b^c
CED SYN 2 x^1^z
CED 1.0 User's Guide - 11
By executing "2", the commands issued will be x, a, b, c,and z.
The only limitation is that the stored commands ready for
chaining must not exceed 512 characters total. In the above
example, after you have keyed "2" and the "x" is passed to the
operating system, the stored commands will be:
1^z
which requires 4 characters of storage (3 for the stored
commands, plus one for a terminating carriage return). The next
time CED is called, it will note that "1" is a synonym; the first
"1" command ("a") is passed to the operating system, and the new
stored commands will be:
b^c^z
which requires 6 bytes of storage. At no time can this list of
stored commands exceed 512 bytes; characters pushed beyond the
end of this storage will be lost.
For whatever it's worth, you can use chaining directly at the dos
prompt:
C> dir^cd \
will work as you'd expect. There is one restriction: the first
command (before the ^) cannot be a CED synonym. You can overcome
this by simply adding an initial ^ character:
C> ^syn1^syn2
You may alter the chain character (command separator) via the CED
command
CED CHAINCH <char>
So, for example, "CED CHAINCH &" would replace ^ with & as the
command separator. The chain character can, but probably should
not, be a control character. If you are typing the command
directly into CED, you can just type the control character:
CED CHAINCH <Ctrl-A>
However, if you are setting the chain character via configuration
files (below), it may not be possible to type in the control
character directly. For this reason, you can also specify a
control character by typing the caret (^) and a letter key.
Thus, if you wanted to use ^Y as the chain character, you would
use '^' and 'Y':
CED CHAINCH ^Y
Certain control characters should not be used as for this
purpose, because they are used for other functions by DOS; among
CED 1.0 User's Guide - 12
these are ^C (cancel), ^G (bell), ^H (backspace), ^I (tab), ^J
(linefeed), ^M (carriage return), ^P (printer on), and ^S (stop).
The use of control characters as described has more meaningful
use in setting the "ignore" and "status request" characters
(below).
Command parameters
------------------
This section describes how synonyms and command chaining interact
with command line parameters.
The simplest case is a single word synonym like
CED SYN d dir
which specifies no special parameter handling. In this case, any
command line parameters are simply tacked on after the synonym
substitution: "d *.exe /w" becomes "dir *.exe /w".
If the synonym itself contains parameters:
CED SYN dw dir /w
a similar situation holds. For example, "dw *.asm" becomes "dir
/w *.asm". You might think of these simple synonyms as just
substitutions: when CED sees the synonym, it will simply
substitute the replacement text, leaving the rest of the command
line alone.
This simple substitution, however, means that your command line
parameters must always be the last text of the synonym. There
would be no way, for example, to define a synonym that would
obtain a directory of <name>.exe, where <name> is some filename
entered on the command line and ".exe" is part of the synonym.
That is, it would not be possible to define a synonym "d" such
that the command
d foo
would result in a "dir foo.exe" command.
CED does provide a way to substitute parameters into the
middle of a synonym. CED recognizes the "%n" dummy parameter
format used by DOS batch files. %1 represents the first command
line parameter, %2 is the second, and so on, up to %9. Refer to
your DOS documentation (batch file section) if this is unclear.
Thus, a synonym which would provide the example function is:
CED SYN d dir %1.exe
CED 1.0 User's Guide - 13
When "d foo" is executed, "foo" (the first command line
parameter) is substituted for the %1, resulting in the desired
command "dir foo.exe".
When a synonym contains chained commands, all parameter
substitution is performed at one time, before the chain is
started. Thus,
CED SYN f a %1^b %2^c %3
when executed "f one two three" will result in three commands:
a one
b two
c three
If a chain-command synonym contains no dummy parameters (no %'s)
the command line parameters will be appended to the end of the
chain, i.e., as parameters to the last command. So,
CED SYN f a^b^c
when executed "f foo" will result in the three commands:
a
b
c foo
You can change the dummy parameter character from '%' to another
character using the
CED PARAMCH <char>
command. The rules described for CHAINCH apply here.
Ignoring commands
-----------------
There may be certain commands that you do not want CED to
process; for example, you might not want the ERASE command
stacked. To instruct CED to ignore a command, use the CED
command
CED IGNORE <command>
For example:
CED IGNORE erase
When a command is set to IGNORE, CED will not place it in the
command stack, check for synonyms, or perform any PCALL pro-
cessing (even if you have set PCALL for that command).
CED 1.0 User's Guide - 14
Remember, though, that it is CED that "ignores" a command, not
DOS. The command CED IGNORE FORMAT does NOT prevent the user
from executing a FORMAT command; it simply stops CED from placing
the command into the stack, looking for a synonym named FORMAT,
etc.
Ignoring individual commands
----------------------------
You may sometimes want CED to ignore processing of a specific
command. For example, you may have "dir" defined as a synonym
for an external program that will display a sorted directory, but
on occasion want to display a standard DOS directory. To force
CED to suspend all processing of a command, precede it with ^N
(Ctrl-N). If the first character of input is ^N, CED will not
stack the command, check for synonyms, or perform any PCALL
processing (just as if it were IGNOREd). The Ctrl-N, of course,
is not passed to DOS or to the application program. For example:
^Ndir
If you find ^N inconvenient, you can change the ignore character
to a different character by using the IGNORECH command:
CED IGNORECH ^T
CED IGNORECH !
See the section on compound synonyms (above) for more information
on how to enter control characters in this command.
Clearing CED objects
--------------------
From time to time it may be useful to clear a CED "object": a
PCALL command, a synonym, or an ignore command. The CLEAR
command allows you to do this. The formal syntax is:
CED CLEAR <function> [[FROM] <name>]
This looks more complex than it is. The <function> is one of
SYN, USERSYN, PCALL, and IGNORE. Since the [[FROM] <name>] is
optional, the simplest form of the clear command is exemplified
by:
CED CLEAR SYN
which will clear all synonyms. Similarly,
CED CLEAR PCALL
clears all PCALL commands.
CED 1.0 User's Guide - 15
You may clear an individual item by including its name. For
example:
CED CLEAR USERSYN foo
clears the user synonym "foo", leaving all others synonyms
undisturbed.
Finally, you can clear all items FROM a specified item through
the end of the list with the FROM option. For example:
CED CLEAR USERSYN FROM foo
would clear the user synonym "foo" and all synonyms listed after
"foo". This command is particularly useful if you have loaded a
temporary set of synonyms for some special purpose. Suppose, for
example, that you have a set of synonyms already in memory, then
you load an additional set to be used temporarily. When you are
done, the command
CED CLEAR SYN FROM foo
would delete all of the "temporary" synonyms, assuming that the
first of these was "foo".
Note that SYN and USERSYN objects share storage. Thus, a CLEAR
SYN FROM <item> or CLEAR USERSYN FROM <item> will clear all
synonyms (of either type) FROM the named item. Similarly, CLEAR
SYN and CLEAR USERSYN are functionally identical: all synonyms of
either type will be cleared.
Configuration files
-------------------
Obviously it would be inconvenient to have to type in all of
these commands every time you use your computer. However, you
may put any CED command into a special CED configuration file,
and have them loaded all at once.
The configuration file is simply an ASCII text file (created by
your text editor, EDLIN, or word processor in nondocument mode)
that contains a series of CED commands. Just leave out the
keyword "CED", but include the rest of the command:
Rem Remarks are OK if preceded by "REM"
Rem
Rem Set chain char to '&'
Chainch &
Rem Set ignore char to '!'
Ignorech !
Rem Set a few synonyms
Syn d dir
Syn e edit
CED 1.0 User's Guide - 16
Syn cis cd \talk & talk cis & cd \
Usersyn dd d ds:1017 L40
Rem And a few PCALL commands
PCALL e
PCALL debug
Rem Ignore all DEL, ERASE, and FORMAT commands
Ignore erase
Ignore format
Ignore del
To read in your file, use the CED -F command line option:
CED -F<filename>
For example, if your configuration file is call CED.CFG, you'd
use
CED -Fc:\boot\ced.cfg
If you load new configuration files during one computer session,
the PCALL, SYN, USERSYN, and IGNORE commands are added to those
already stored, without regard to duplication (see "Multiple
definitions" below).
Note that if you have several commands that you want to enter
into CED (but don't have them in a file), you can use
CED -Fcon
(which specifies CON: as the configuration file name) and then
type a series of CED commands from the keyboard. Type ^Z when
you are done.
Changing default buffer sizes
-----------------------------
CED maintains six separate internal buffers (regions of memory
where data is stored). Each buffer is initially set to a default
size. The buffers and their default sizes are:
1. DOS command stack (2048 bytes)
2. Application program command stack (1024)
3. Synonym list (2048)
4. PCALL list (1024)
5. Ignore command list (1024)
6. User command list (described below) (1024)
You may make these buffers larger or smaller by including a list
of buffer sizes the FIRST time you load CED during a session
(i.e., when you turn on the computer, or after a Ctrl-Alt-Del
reboot). Use a -B switch as the FIRST CED command:
CED -Bn1,n2,n3,n4,n5,n6
CED 1.0 User's Guide - 17
where n1 is the desired size for buffer 1 (DOS command stack), n2
is the size for buffer 2 (App program command stack), etc. You
need not specify all sizes, but if you skip one or more sizes
(telling CED to use the default) you must include the separating
commas. Examples:
CED -B1000,2000,3000,4000,5000,6000 (Set all sizes)
CED -B1000,,3000 (Set sizes 1 and 3)
CED -B,,,,,6000 (Set size 6 only)
You cannot set any individual size less than 64 bytes, and the
total of all sizes must be not exceed 52K (53248) bytes.
Remember that the -B command must be the FIRST command used the
FIRST time you run CED during each session. It is not valid any
other time. If you wish to set sizes and read a configuration
file during autoexec, the syntax would be:
CED -Bn1,n2,n3,n4,n5,n6 -F<filename>
For your general information, here is what is stored in each of
the buffers, and what happens when they fill:
1. DOS Command stack: all non-ignored commands of 3 or more
characters entered at the DOS prompt. The command is stored
before synonym and PCALL processing. Each stored command
requires one byte more than the length of the command. When the
buffer fills, the oldest command is deleted.
2. Application program command stack: same as above, except
commands entered at participating program prompts are stored
here.
3. Synonym list: the full list of synonyms (both DOS and user
synonyms) plus their meanings. Each entry requires the combined
length of the synonym and its associated command plus three
bytes. When the synonym list fills, no new synonyms will be
accepted unless a CLEAR is performed first.
4. PCALL command list: the list of all PCALL commands plus the
most recent parameter list for each. Each entry requires the
combined length of the command and its current parameters
(including leading separators) plus two bytes. If the buffer is
full when a "CED PCALL" command is entered, the new PCALL command
will not be accepted. If the buffer is full when a PCALLable
command is entered, its parameters will not be remembered.
5. Ignore command list: the list of all IGNORE commands. Each
entry requires the command length plus one byte. If the buffer
is full when a new "CED IGNORE" command is entered, the new
command will be rejected.
CED 1.0 User's Guide - 18
6. User-installed command list: the list of all user-installed
commands. Requires the command length plus six bytes of storage
for each. New commands will be rejected if the buffer is full.
Status display
--------------
You can obtain a partial display of CED status any time CED is
active (i.e., at the DOS prompt or in a compatible program
awaiting input). Do this by hitting ^T (Ctrl-T). CED will first
display all SYNonyms and USERSYNonyms, then a list of all buffer
sizes. For each buffer CED will show the total bytes allocated
and the number of bytes free.
When the display is complete, CED will redisplay any partial
input that you typed before ^T, and you may continue data entry.
If ^T is not convenient, you can change the status request
character by using the CED command
CED STATCH <character>
as in "CED STATCH ^A" or "CED STATCH %". See the section on
command chaining for more information on using control characters
in this command.
Multiple definitions
--------------------
It is possible to duplicate a definition within one of the CED
lists (SYN, USERSYN, PCALL, IGNORE). For example, you may create
more than one synonym for "d". In the event of multiple
definitions, CED will always use the newest.
Suppose, for example, that you have "d" defined as a SYN for
"dir". If you subsequently issue the command "CED SYN d debug",
you will have two synonyms for "d". When you enter "d", CED will
use the latest definition: "debug". If you then issue a "CLEAR
SYN d", CED will again use the latest definition and clear the
"debug" synonym, at which point the "dir" definition again
becomes effective.
Multiple definitions have no real meaning for PCALL and IGNORE,
but they are supported nonetheless.
Problem determination
---------------------
If you find any problems with CED, please report them to me,
preferably at CompuServe ID 76703,2002. Before reporting
problems, however, PLEASE take the following steps:
CED 1.0 User's Guide - 19
1. REREAD THE DOCUMENTATION! The majority of "problems"
that have been reported to date could have been solved by a
careful review of this Guide.
2. Install CED in a "clean" environment, i.e., without any
other resident utilities. Temporarily rename your
AUTOEXEC.BAT and CONFIG.SYS files to other names; reboot,
reinstall CED, and test. If it works correctly, there is a
conflict with some other program. Try to isolate the
conflict by reinstalling your other programs one by one. You
may even be able to resolve the conflict by varying the load
order. If you locate the conflict, let me know about it. I
cannot guarantee that it will be resolved, but I will make
an attempt when time permits.
It will not be necessary to rename CONFIG.SYS if it only
contains FILES, BUFFERS, COUNTRY, FCBS, and ANSI.SYS
statements.
If the problem persists, please report the problem as accurately
and completely as possible. Include the CED version number
(obtained by the command CED VER), and a listing of your
CONFIG.SYS and AUTOEXEC.BAT files if you think that might have
some bearing (they usually do).
These are by far the three most common problems we've encountered
over the years:
PROBLEM: the command editor works, but synonyms don't. If
you have a synonym named "D" and you type "D" at the DOS
prompt, DOS says "Bad command or filename".
CAUSE: PCED probably thinks that it's at a user program
prompt rather than at the DOS prompt, i.e., it thinks it's
in DEBUG or some such rather than at the command prompt.
You can confirm this by typing two commands at the DOS
prompt:
CED USYN d dir
d
If you see a directory, this is definitely the cause.
SOLUTION: the DOS prompt must be the FIRST request for
keyboard input after CED is loaded. If you have anything in
your AUTOEXEC.BAT after CED that needs keyboard input, move
it to a position before CED. In 95% of the cases reported
to us, this problem has been caused by the presence of a
DATE and/or TIME command in AUTOEXEC after CED has already
been loaded. Just move DATE/TIME to a position "earlier" in
the batch file so that they run before CED. By the way,
PCED (the commercial version of CED), is smarter about DOS
prompt recognition and never suffers from this problem.
CED 1.0 User's Guide - 20
----------
PROBLEM: When you execute a synonym that contains multiple
commands, you find that you have to press <Enter> or another
key after the first command in order to execute the rest of
the commands.
CAUSE: You are using a resident program that uses some
rather old technology.
SOLUTION: identify the perpetrator. Suspects are any
resident programs loaded after CED. Remove suspects from
your AUTOEXEC.BAT one by one until the problem goes away;
the last one removed was the culprit. Then, try reversing
the load order so that the offending program loads before
CED; sometimes this will fix the problem. If not, discard
the offender or upgrade to a newer version (most resident
programs don't do this any more--it was a much more common
problem in the mid-80's than it is in the 90's).
----------
PROBLEM: You are surprised to find that you can't enter data
beginning with the word "CED" into a program (EDLIN or LIST,
for example).
CAUSE: CED is "active", as defined above. Thus, as
documented, CED is watching for commands--which begin with
the keyword CED. Your input is being interpreted as a CED
command, not as data to your program.
SOLUTION: precede the data you are entering by the ignore
character (^N).
CED 1.0 User's Guide - 21
Appendix A: Command summary
---------------------------
The following is a complete summary of all CED commands. These
commands may be included in a CED configuration file (with the
exception of -F and -B), or they may be typed in directly by
prefixing them with "CED ".
-Bn1,n2,n3,n4,n5,n6 Sets the sizes of the six internal
buffers. Valid ONLY as FIRST command
when installing CED after boot or
reboot.
-F<Filename> Loads a CED configuration file. Not a
valid command within a config file.
SYN <synonym> <command> Defines a synonym. The first word is
the synonym, all remaining words are
substituted for the synonym.
USERSYN <synonym> <command> Defines a user synonym. Identical
to SYN, except that the synonym is
available within user programs rather
than at the DOS prompt.
PCALL <command> Defines a command subject to PCALL
processing.
IGNORE <command> Defines a command to be ignored--CED
will not perform any processing on this
command at all.
CHAINCH <char> Defines the command chaining character,
which is the character used to separate
commands in a multi-command synonym.
Normally '^'.
IGNORECH <char> Defines the keyboard-ignore character;
when this character is typed as the
first character of keyboard input, CED
will perform no further processing on
it. Normally ^N.
STATCH <char> Defines the status request character.
When you type this character while CED
is active, CED will display its status.
Normally ^T.
PARAMCH <char> Defines the dummy parameter character.
Normally '%'.
CLEAR <function> [[FROM] <name>] Clears all or part of a
list of CED objects. <function> is one
of SYN, USERSYN, PCALL, or IGNORE.
CED 1.0 User's Guide - 22
Without arguments, clears all of the
specified list. With a <name>, clears
that item only. With a FROM <name>,
clears that item and all subsequent
items.
VER Display CED version number and copyright
notice.
Commands may be abbreviated as follows:
USERSYN USYN
PCALL PC
IGNORE IG
CHAINCH CC
IGNORECH IC
STATCH SC
PARAMCH PM (NOT PC!)
CLEAR CL
Note, however, that the arguments to CLEAR may NOT be
abbreviated; CLEAR USYN or CLEAR IG are not valid.
CED 1.0 User's Guide - 23
Appendix B: Order of Processing
-------------------------------
CED performs its basic processing in the following order:
1. Obtain input. If there is a chained command pending, obtain
input from the chain; otherwise from keyboard.
2. Check for "ignore". If command is an "ignore" command or if
the first character of input is the ignore character, skip all
further processing.
3. Stack the command (if longer than two characters) in the
appropriate command stack.
4. Perform PCALL (parameter recall) processing and store the
result for PCALL processing next time the same command is
entered.
5. Perform synonym processing and parameter substitution.
6. Check for CED command. If input is a CED command, process and
clear the input (returning null string to caller). Skip rest.
7. Check for command chaining. If the chain character appears in
the input, store all commands after the first chain character for
later processing, and pass back the first command only.
8. Examine the resulting command and see if it's a user-installed
command. If so, call user command processor.
CED 1.0 User's Guide - 24
Appendix C: Limitations
-----------------------
There is a limit of 255 characters on any input line from a CED
configuration file. DOS will limit you to 127 characters at the
DOS prompt.
For PCALL, SYN, USERSYN, and IGNORE to be effective, their
commands must begin in the first column of input and must be
separated from any parameters by one of the following characters:
; , < > | = + [ ] / <Tab> <Space>
Thus, if you have "cd" defined for PCALL processing, "cd\" will
not work correctly. However, "cd \" will be OK. Similarly, if
you have a synonym "d" for "debug", the command "c:\util\d" will
not work, nor will " d" (note leading space).
Remember that CED is active only at the DOS prompt or when a user
program requests input via DOS function 0AH. This has several
effects:
Programs that allow you to execute DOS commands or other
programs as subtasks generally do not use DOS function 0AH
to input the name of the subtask or command; thus, CED is
not active, and synonyms are usually not effective.
CED cannot operate on statements in batch files. Thus,
synonyms and user-installed commands will not be recognized
if they are batch statements, and CED commands will cause
CED to be reloaded (which is probably not what you want).
CED 1.0 User's Guide - 25
Appendix D: Version History
---------------------------
1.0 5/13/85
Original version.
1.0A/B 6/1/85
PARAMCH added. Fixed problem that caused unpredictable
results if DOS function 0AH called with 8088 direction flag
set. Status display cleaned up. Processing order altered
to allow synonyms for CED SYN to process correctly. Early
ROM BIOS bug relating to cursor size trapped. Config file
processing speeded up. Problems parsing -B command fixed.
Nesting synonyms allowed, as well as direct entry of chained
commands at the DOS/program prompt. Some minor
incompatibilities with other resident programs eliminated.
1.0C 6/3/85
Problem with immediate parameters to SYNs (e.g., "d/w",
where "d" is a SYN) corrected. Problem with PCALL list
overflow corrected. Fixed error with ^Z processing during
configuration file read.
1.0D 12/7/85
Added <^Home>, <^Bksp>, and <F3> (incorrectly documented as
being included in version 1.0C). Corrected a few minor (and
unreported!) bugs.
1.0E 7/24/91 (yes, we're still here)
Adds SAVESTK, LOADSTK, and INSMODE commands; improves word
parsing for editor's word left/right; detects reload from
disk.
CED 1.0 User's Guide - 26
Appendix E: PCED (the commercial version)
-----------------------------------------
In 1986, after much encouragment by users of CED, we released an
enhanced commercial version of CED. This was not our intent when
the CED project was begun, but the program proved to be
extraordinarily popular, and the amount of time spent responding
to mail and phone calls about the program was out of all
proportion to what we could afford.
The commercial version is called PCED, for Professional CED. PC
Magazine has this to say about PCED:
PCED is a rare example of almost perfect program design.
PCED is crashproof, doesn't care when it's loaded, and
never gets in the way. Everything it does can be
modified, suspended, or suppressed.
If you can fit only one utility on your disk, make it
PCED.
PCED contains these enhancements and new features, and more:
COMMAND EDITOR
Function keys F1-F4 and F6 have been implemented for DOS
compatibility. This is particularly useful in EDLIN.
Word delete and character transposition keys.
Filename completion: just type part of a filename (using DOS
wildcards if you wish) and hit the TAB key; PCED will search
the disk directory and "suggest" matching filenames one by
one. For example, instead of typing AUTOEXEC.BAT, you might
type AU and hit the TAB key; PCED will quickly find
AUTOEXEC.BAT and fill it in for you.
You can preview the current PCALL parameters for any command
by simply typing the command name and then hitting <^R>.
The current parameter(s) are added to the command line for
editing.
COMMAND STACKS
Stack searching: to find a particular command, just type the
first few characters before you hit the <Up> key. PCED will
display only the commands that match what you've typed.
VSTACK provides an optional windowed, "point & shoot"
version of the command stack. Your stack is displayed in a
scrollable pop-up window; just highlight the command you
want and execute it directly or bring it back to the command
line for editing.
CED 1.0 User's Guide - 27
You can execute any command without adding it to the stack,
and you can add a command to the stack without executing it.
This is especially helpful when you've typed half of a long
command and can't quite remember the syntax: just put the
unexecuted partial command into the stack and get help; then
retrieve and complete the command.
You can execute and retrieve commands from the stack by
referring to an index number.
In addition to the text form of the stack save as
implemented by CED's SAVESTK, you can save the stacks in a
special binary format that, when reloaded, precisely
duplicates your current conditions: the stack pointers will
be where they were when the stack was saved, etc. The form
of SAVESTK saves both stacks PLUS all of your PCALL
information. When you boot up in the morning, PCED will be
in precisely the same state it was in when you shut down.
The new SHOW command displays the contents of the stack.
The new MINSTACK command allows you to set the minimum
length of commands that you want stacked.
The new WRAP command specifies whether you want a circular
or linear stack.
SYNONYMS
Your synonyms can set and use environment variables. With
this feature, you can, for example, create synonyms that
will add a directory to your PATH and delete it later; even
create a generic environment-editing synonym.
Synonyms can also access and use system information such as
the current date, time, drive, directory, etc. Using this
feature you can create a synonym that will change to a new
directory and automatically create a "return" synonym to
return to your current directory when you are done (and
these can be "nested"!); create filenames based on the
current date, time, or even day of the week.
Synonyms are fully "nestable": any command in a synonym can
be another synonym, including the first command (a
restriction in CED).
You can specify a "minimum abbrevation" of a synonym: the
synonym "ed*it" can be executed by any of "ed", "edi", or
"edit".
You can specify default parameters--command parameters that
will be added if the user does not specify them. For
example, you can make FORMAT format drive B unless you
specify a different drive.
CED 1.0 User's Guide - 28
You can pick apart filename parameters: your synonyms can
access the drive, directory, name, and extension of any
parameter. You can use this to, for example, copy files
from drive C to drive B and change the extensions to .BAK
while doing so.
You can define "internal" synonyms, which amount to
shorthand notations for frequently typed text. For example,
you might define UM as a synonym for C:\UTIL\MISC; then you
can type commands such as CD @UM and PCED will change it to
CD C:\UTIL\MISC.
You can easily delete duplicate synonyms and edit existing
synonyms.
Commands generated by compound synonyms do not go into the
command stack, and you can suppress their display, too.
PCED recognizes the existence of separate copies of the
command shell and does not execute pending commands (from
synonyms) in subsidiary copies of the shell. You can start
new synonyms in the second shell, and PCED will not confuse
these commands with pending commands from other shells.
OTHER NEW COMMANDS (PARTIAL LIST)
SAVE saves your current configuration to disk via the new
SAVE command. All of your synonyms, your PCALL and IGNORE
lists, and many of PCED's current operating parameters are
placed in a configuration file which you can then edit, or
read into PCED via the LOAD command (which replaces CED's "-
F" command).
KILL removes PCED from memory, and OFF disables PCED but
leaves it resident. A subsequent ON restores normal
operation.
LIT instructs PCED to suspend special processing of special
characters like ^.
HELP provides comprehensive help about any PCED command or
feature. Help information is user-editable and expandable.
STATUS displays information about PCED's status; you define
precisely what information you want to see.
CURSOR, HEIGHT, and PROMPT provide improved screen control.
CURSOR defines the cursor size and shape; HEIGHT sets the
screen size (which can also be auto-detected); and PROMPT
allows you to define a special PCED prompt and, optionally,
a screen location.
QUEUE schedules a command for execution at the next DOS
prompt (perhaps, "after this batch file is finished"), and
CED 1.0 User's Guide - 29
CANCEL provides a facility for rudimentary conditional
execution in synonyms.
MISCELLANEOUS OTHER FEATURES
The keyboard is fully redefinable: you can assign any PCED
function to any valid keystroke. You can also define text
macros; for example, you can have F10 execute a DIR A:
command. Better than ANSI.SYS because these macros do not
affect user programs.
Single-key review of scrolled-off data. If you want to see
that directory that scrolled off the screen a few minutes
ago, just press <PgUp>.
You can log all of your DOS commands to disk, with date and
time. You can even include a four-character user ID in your
command log.
You can use all PCED commands in batch files; and you can
use most PCED synonyms in batch files via the new XCED
utility program (included with PCED).
Ctrl-Break handling is much improved.
Included are optional programs that: send arbitrary
information to any file or device (good for printer control,
etc.); provide repeated operations on a list of files
contained in a text file; display flexible sorted
directories in extension-based colors; improve display
speed.
For programmers, there's a much stronger external interface
that allows you to use and control many of PCED's features.
You can even gain access to PCED synonyms.
200+ page bound, indexed manual. Everything you need to
know to use PCED as a beginner, intermediate, or advanced
user. Plenty of hints, tips, and sample synonyms.
Remember, this is only a partial list of new features. The PCED
package includes all of the above plus a typeset bound and
indexed manual.
CED 1.0 User's Guide - 30
Appendix F: Ordering PCED
-------------------------
The following information is correct as of July 1, 1991. All
charges are quoted in US dollars.
PCED is available from:
The Cove Software Group
Post Office Box 1072
Columbia, Maryland USA 21044
(301) 992-9371
Price per copy:
The single copy price is $50.00 plus tax where applicable
($2.50 to Maryland purchasers). Site licenses and quantity
discounts are available; call or write for information.
Shipping & handling charges:
First copy Ea. add'l
---------- ---------
Continental U.S. (48 states) $ 4.00 $1.00
Alaska/Hawaii 9.00 2.00
Canada 7.50 2.00
Other international 11.00 3.00
Orders are shipped via UPS surface to the continental U.S.
and UPS air to Alaska and Hawaii (international orders are
shipped by appropriate means). UPS cannot deliver to Post
Office Boxes; please add $1.00 for First Class mail.
Additional charges apply for faster shipments (Second Day
Air, Next Day Air, etc.); please inquire for current rates.
Add $2.75 for C.O.D. shipments.
Payment methods:
We accept Visa, MasterCard, and American Express credit
cards; personal and corporate checks or money orders; C.O.D.
(US only; $2.75 additional); purchase orders from
governmental units and approved corporate customers. All
orders must be paid in US dollars. Checks must be drawn on
a US bank or the US office of a foreign bank.
System requirements:
- IBM PC, PCJr, XT, AT, PS/2, or true compatible.
- MS-DOS or PC-DOS 2.00 or later.
- With EMS memory, about 16K of DOS memory plus 16K of EMS.
Without EMS, about 30K of DOS memory.
CED 1.0 User's Guide - 31
Appendix G: User-installed commands
-----------------------------------
This appendix describes how to add new resident commands to DOS
using CED. It is an advanced topic, and is intended for
programmers only; you don't need to read this section to use CED.
CED provides a means to enqueue new DOS commands, that is, to add
internal commands to DOS. Once enqueued, CED will call a routine
that you specify whenever the user types the new command (at the
DOS prompt, or in a "participating" program).
Access to CED service is provided via a bogus DOS function,
0FFH. This function behaves as a normal DOS function; that is,
you must set up the registers as needed by the call, place a 0FFH
in register AH, and execute an INT 21H. The two subfunctions are
described below; the subfunction code is placed in register AL.
SUBFUNCTION 0: ENQUEUE
This subfunction allows you to enqueue a new command. Input
register use is as follows:
AH = 0FFH (CED service)
AL = 0 (ENQUEUE)
BL = MODE
This is a bit flag that tells CED when to call your
routine. You have the option of being called if your
command is typed at the DOS prompt, at a user program
prompt, or both. Bit 0, if set, specifies that you are
to be called at the DOS prompt; Bit 1, if set,
specifies that you are to be called at a user program
prompt.
DS:SI = command name
This is a dword pointer to your command (i.e., you are
to be called when the user types this string). The
command must be from one to eight characters,
terminated by a carriage return. CED is not case
sensitive.
ES:DI = command processor entry point
This is a dword pointer to the routine that is to be
executed when the new command is entered.
SUBFUNCTION 1: DEQUEUE
This subfunction allows you to dequeue a user command; after a
command has been dequeued, CED will no longer call you if the
user types your command. Input register use is:
CED 1.0 User's Guide - 32
AH = 0FFH (CED service)
AL = 1 (DEQUEUE)
DS:SI = command name
A dword pointer to the name of the command to be
dequeued (i.e., the same DS:SI as was used to enqueue
the command).
RETURN REGISTERS
On return from CED service (DOS function 0FFH), all registers are
preserved except AX. The carry flag, if set, indicates that an
error occurred; AX has the error code, which will be one of:
1: Invalid function. At present, only subfunctions 0 and
1 are supported. Subfunction 2 is reserved.
2: Command not found (DEQUEUE only).
8: Insufficient memory (ENQUEUE only).
13: Invalid data. (ENQUEUE only; bad MODE flag, or invalid
command length).
NOTE: In current versions of DOS, AH returns 0FFH if function
0FFH is requested and CED is not installed. You may use the
reserved subfunction (2), at your own risk, to test for CED
installation. If AH returns any value other than 0FFH, CED is
probably installed.
COMMAND PROCESSOR
Your command processor is entered via a far call from CED. Entry
registers are as follows:
BL = MODE
This is the same bit flag as is used in the ENQUEUE
subfunction. You may use it to test "where you are".
CL = MAXLEN
This is the maximum allowed length of the user input
string (i.e., the value of byte 0 of the DOS function
0AH input buffer) less one.
DS:DX = Command tail pointer
This is a dword pointer to the command tail of the
user's input. For example, if your command is "hello"
and the user types "hello sam", DS:DX will point to the
space after "hello".
DS:DI = Command pointer
CED 1.0 User's Guide - 33
This is a dword pointer to the first byte of the actual
user input.
Note that DS:DI and DS:DX point to buffer space within CED, not
to the actual DOS function 0AH input buffer. There are no length
attribute bytes preceding the buffer; DS:SI points to the first
byte of the buffer, not the third. CED will copy the final
buffer, after all processing, to the actual input buffer.
You may manipulate the buffer to your heart's content. It is 255
characters long, but CED will truncate the string if necessary
(if the final command is longer than the maximum allowed by the
function 0AH request). In particular, note two things about the
CED buffer:
1. The string MUST be terminated by a carriage return
ASCII 13).
2. If you null out the buffer (by putting a carriage
return in relative byte 0) CED will return a null
string to DOS or the user program. This is probably
what you will want to do.
There are few restrictions on what you can do within your service
routine. You may request other DOS service (EXCEPTION: do not
request more buffered input via function 0AH!!), and you need not
preserve any registers except SS:SP. The stack in effect on
entry will have about 200 bytes free; switch to a larger internal
stack if necessary.
Return to CED via a far RET.
Appendix H contains a sample assembler program to enqueue a
trivial command.
CED 1.0 User's Guide - 34
Appendix H: User Command Demo
-----------------------------
Comment *
userdemo.com - demo of CED user command enqueuing
Assembly: MASM userdemo;
LINK userdemo; (ignore NO STACK message)
EXE2BIN userdemo userdemo.com
Use: Just type 'userdemo'. You now have
a new DOS command, "hello"
Author: CJDunford
05/28/85
*
CED equ 0FFH ; Special "DOS" fn for CED service
ENQUEUE equ 0 ; Subfunction: enqueue
DEQUEUE equ 1 ; Subfunction: dequeue
DOS equ 1 ; Cmd to be active at DOS prompt
USER equ 2 ; Cmd to be active at user prompt
CR equ 13
LF equ 10
code segment
assume cs:code,ds:code
org 100H
main proc far
jmp short Install ; Go to installation
; -----------------------------------------------------
; This is the command processor. It will be called
; whenever the user types "hello" at the DOS prompt.
; The routine simply prints the string "Hi there, ace".
;
; On entry:
; BL: mode flag
; 1 = at DOS prompt
; 2 = at user program prompt
; CL: max length of input
; DS:SI => user command
; DS:DX => user command tail
;
; Remember to null out the user string so that
; it is not passed on to DOS, then exit via a far
; return to CED. Not necessary to preserve any
; registers.
; ------------------------------------------------------
CED 1.0 User's Guide - 35
Hello proc far ; Must be a far procedure
mov byte ptr [si],CR ; Null out the user's input
mov ax,cs ; Set up local addressing
mov ds,ax
mov dx,offset HiThere$ ; Display our message
mov ah,9
int 21H
ret ; No need to restore any regs
Hello endp
HiThere$ db 'Hi there, ace',CR,LF,'$' ; Message to be displayed
; -----------------------------------------------
; This is the installation routine. It sets up
; the regs for a call to the CED command enqueuing
; service, enqueues the command, and terminates,
; leaving the command service routine resident
; ------------------------------------------------
Install:
mov ah,CED ; CED service request
mov al,ENQUEUE ; Enqueue a new command
mov bl,DOS ; To be active at DOS prompt
mov si,offset Hello$ ; DS:SI => command ("Hello")
mov di,offset Hello ; ES:DI => service routine
int 21H ; Enqueue new command
jnc OK ; No carry, no error
mov dx,offset Error$ ; Only 1 error possible here
mov ah,9 ; Print string
int 21H
int 20H ; Return to DOS
OK:
mov dx,offset Install ; OK: terminate/resident
int 27H
main endp
Hello$ db 'hello',CR ; New command
Error$ db 'CED user command list full',CR,LF,'$'
code ends
end main
CED 1.0 User's Guide - 36
COPYRIGHT/LICENSE/WARRANTY
--------------------------
This document and the program file CED.COM ("the software") are
Copyright (C) 1985, 1986, 1991
The Cove Software Group
Post Office Box 1072
Columbia, MD 21044
All Rights Reserved
The copyright owner hereby licenses you to: use the software
except as below; make as many copies of the program and
documentation as you wish; give such copies to anyone; and
distribute the software and documentation via electronic means.
There is no charge for any of the above.
You are specifically prohibited from charging, or requesting
donations, for any such copies, however made; and from
distributing the software and/or documentation with commercial
products without prior permission in writing from the copyright
owner.
Persons and organizations who are engaged in the distribution of
shareware, "freeware", and/or public domain software may include
CED on distribution disks as long as charges are made on a per-
disk basis rather than a per-program basis. The charge per disk
may not exceed $7 US. Such persons and organizations must not
represent themselves as vendors, distributors, or sellers of CED.
CED may not be used in a commercial, governmental, or
institutional environment. It is intended for personal use only.
The commercial program PCED is available for other users.
No copy of the software may be distributed without this document;
and the contents of the document must not be altered.
There is no warranty of any kind, and the copyright owner is not
liable for damages of any kind. By using this free software,
you agree to this.
---------------------------
IBM is a registered trademark of IBM Corp.
MS-DOS is a trademark of Microsoft Corporation.
CED 1.0 User's Guide - 37